#ifndef __GRAPHIC_PARTICLE_EMITTER__
    #define __GRAPHIC_PARTICLE_EMITTER__

    // .. REFERENCES

	#include "object.h"
	#include "primitives.h"
    #include "graphic_particle_table.h"
	#include "timer.h"
	#include "defs.h"

    // .. TYPES

    class GRAPHIC_PARTICLE_EMITTER :
        public OBJECT
    {
        // -- PUBLIC

    public :

        // .. TYPES

        DECLARE_REF( GRAPHIC_PARTICLE_EMITTER );

        // .. CONSTRUCTORS

        GRAPHIC_PARTICLE_EMITTER();

        // .. ACCESSORS

        virtual VOID SetDuration(
            const REAL & duration
            )
        {
            Duration = duration;
        }

        // ~~

        const REAL & GetDuration()
        {
            return Duration;
        }

        // ~~

        VOID SetCurrentTime(
            const REAL & time
            )
        {
            CurrentTime = time;
        }

        // ~~

        const REAL & GetCurrentTime()
        {
            return CurrentTime;
        }

        // ~~

        VOID SetIsLoop(
            const BOOL it_is_loop
            )
        {
            ItIsLoop = it_is_loop;
        }

        // ~~

        BOOL IsLoop() const
        {
            return ItIsLoop;
        }

        // .. OPERATIONS

        virtual VOID Emit(
            GRAPHIC_PARTICLE_TABLE & particle_table,
            const TIMER & time_step
            );

        // ~~

        virtual VOID Reset();

        // ~~

        VOID Pause(
            const BOOL it_must_pause
            );

        // -- PROTECTED

    protected :

        // .. ATTRIBUTES

        REAL
            Duration,
            CurrentTime;
        INT
            Rate;
        BOOL
            ItIsLoop,
            ItIsPaused;

        // -- PRIVATE

    private :

        // .. CONSTRUCTORS

        GRAPHIC_PARTICLE_EMITTER(
            const GRAPHIC_PARTICLE_EMITTER & other
            );

        // .. OPERATORS

        GRAPHIC_PARTICLE_EMITTER & operator=(
            const GRAPHIC_PARTICLE_EMITTER & other
            );
    };
#endif
